package io.wdb.common.exception;


/**
 * 自定义异常
 * 
 * @author wdb
 * @email admin@wdb007.com
 * @date 2016年10月27日 下午10:11:27
 */
public class RRException extends RuntimeException {
	private static final long serialVersionUID = 1L;
	
    private String message;
    private int code = 500;
    private int result = 1;
    
    private RspCodeEnum rspCodeEnum ;
    
    public RRException(String message) {
		super(message);
		this.message = message;
	}
    
    public RRException(RspCodeEnum rspCodeEnum) {
    	this.rspCodeEnum = rspCodeEnum;
		code = rspCodeEnum.getRspCode();
		message = rspCodeEnum.getRspMsg();
	}

	
	public RRException(String message, Throwable e) {
		super(message, e);
		this.message = message;
	}
	
	public RRException(String message, int code) {
		super(message);
		this.message = message;
		this.code = code;
	}
	
	public RRException(String message, int code, Throwable e) {
		super(message, e);
		this.message = message;
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public int getResult() {
		return result;
	}

	public void setResult(int result) {
		this.result = result;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}
	
	public RspCodeEnum getRspCodeEnum() {
		return this.rspCodeEnum;
	}
	
}
